/*********************/
/** ControlLightSetting.java */
/*********************/
package atag.apps.mainApp;

import atag.runtime.DataItem;
import atag.runtime.DataPool;
import atag.runtime.NodeInfo;

public class ControlLightSetting implements Runnable {

	private final NodeInfo m_myState;
	private final DataPool m_dataPool;

	/** Creates a new instance of ControlLightSetting */
	public ControlLightSetting(DataPool dp, NodeInfo myconfig) {
		m_dataPool = SharedStoreForGUITasks.m_dataPool = dp;
		m_myState = SharedStoreForGUITasks.m_myState = myconfig;
	}

	public void run() {
		/* Checking for each DataItem, to see which one was produced */
		DataItem t_dataItem;
		if ((t_dataItem = m_dataPool.getData(IDConstants.T_CONTROLLIGHTSETTING,
				IDConstants.D_LIGHTINFORESPONSE)) != null) {
			LightInfoResponse recvdLightInfoResponse = (LightInfoResponse) t_dataItem
					.core();
			this.handleLightInfoResponseProduced(recvdLightInfoResponse);
		}
	}

	private void handleLightInfoResponseProduced(
			LightInfoResponse r_LightInfoResponse) {
		int ID = r_LightInfoResponse.getID();
		m_myState.debugPrint("[ControlLightSetting]Got a Var1 " + ID);
		int lightReading = r_LightInfoResponse.getLightReading();
		
	}
}
